package com.example.guavaSrudy.BasicEvent.better;

import com.google.common.collect.Lists;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import lombok.Data;

import java.util.List;

@Data
public class TradeBuyAuditor {

    private List<BuyEvent> buyEvents = Lists.newArrayList();

    public TradeBuyAuditor(EventBus eventBus) {
        eventBus.register(this);
    }
    @Subscribe
    public void auditBuy(BuyEvent buyEvent) {
        buyEvents.add(buyEvent);
        System.out.println("Receive buyEvent" + buyEvent);
    }
}
